--- a/unix/Makefile	2009-12-21 14:24:24.000000000 +0300
+++ b/unix/Makefile.new	2009-12-21 14:28:30.000000000 +0300
@@ -38,10 +38,11 @@
 MANFLAGS = 644
 
 # target directories - where to install executables and man pages to
-prefix = /usr/local
+DESTDIR =
+prefix = /usr
 BINDIR = $(prefix)/bin
 MANEXT=1
-MANDIR = $(prefix)/man/man$(MANEXT)
+MANDIR = $(prefix)/share/man/man$(MANEXT)
 ZIPMANUAL = zip.txt
 ZIPMANUALcloak = zipcloak.txt
 ZIPMANUALnote = zipnote.txt
@@ -157,18 +158,13 @@
 
 # install
 install:        $(ZIPS)
-	-$(INSTALL_D) $(BINDIR)
-	$(INSTALL_PROGRAM) $(ZIPS) $(BINDIR)
-	-cd $(BINDIR); $(CHMOD) $(BINFLAGS) $(ZIPS)
-	-$(INSTALL_D) $(MANDIR)
-	$(INSTALL_PROGRAM) man/zip.1 $(MANDIR)/zip.$(MANEXT)
-	$(CHMOD) $(MANFLAGS) $(MANDIR)/zip.$(MANEXT)
-	$(INSTALL_PROGRAM) man/zipcloak.1 $(MANDIR)/zipcloak.$(MANEXT)
-	$(CHMOD) $(MANFLAGS) $(MANDIR)/zipcloak.$(MANEXT)
-	$(INSTALL_PROGRAM) man/zipnote.1 $(MANDIR)/zipnote.$(MANEXT)
-	$(CHMOD) $(MANFLAGS) $(MANDIR)/zipnote.$(MANEXT)
-	$(INSTALL_PROGRAM) man/zipsplit.1 $(MANDIR)/zipsplit.$(MANEXT)
-	$(CHMOD) $(MANFLAGS) $(MANDIR)/zipsplit.$(MANEXT)
+		install -d $(DESTDIR)$(BINDIR)
+		install -m 755 $(ZIPS) $(DESTDIR)$(BINDIR)
+		install -d $(DESTDIR)$(MANDIR)
+		install -m 644 man/zip.1 $(DESTDIR)$(MANDIR)/zip.$(MANEXT)
+		install -m 644 man/zipcloak.1 $(DESTDIR)$(MANDIR)/zipcloak.$(MANEXT)
+		install -m 644 man/zipnote.1 $(DESTDIR)$(MANDIR)/zipnote.$(MANEXT)
+		install -m 644 man/zipsplit.1 $(DESTDIR)$(MANDIR)/zipsplit.$(MANEXT)
 
 uninstall:
 	-cd $(BINDIR); rm -f $(ZIPS)
